<template>
  <div class="bread">
    <div class="bread-body">
      <div v-for="(item,index) in navData" :key="index">
        <a class="bread-nav" @click="goNav({item,index})">{{item}}</a>
        <span v-if="index!==navData.length-1">>>></span>
      </div>
      <div class="bread-list">
        <div v-for="(item,index) in paneCityList" :key="index" @click="goProvinceMap(item)">{{item}}</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue'
const props = defineProps(['navData', 'paneCityList'])
const emit = defineEmits(['goNav', 'goProvinceMap'])
const goNav = item => {
  emit('goNav', item)
}
const goProvinceMap = item => {
  emit('goProvinceMap', item)
}
</script>

<style scoped lang="scss">
.bread {
  position: absolute;
  align-items: center;
  z-index: 9999999;
  top: 80px;
  left: 8px;
  .bread-body {
    position: relative;
    display: flex;
    &:hover .bread-list {
      height: 600px;
      width: 100px;
    }
    .bread-list {
      text-align: center;
      position: absolute;
      width: 0px;
      height: 0px;
      background-color: #fff;
      box-shadow: 2px 3px 9px 0px rgba(0, 0, 0, 0.3);
      overflow: scroll;
      top: 20px;
      font-size: 13px;
      color: #808a81;
      transition: all 0.5s;
      &:hover {
        height: 600px;
        width: 100px;
      }
      div {
        height: 20px;
        line-height: 20px;
        overflow: hidden;
        &:hover {
          color: #5a9cf8;
          cursor: pointer;
        }
      }
    }
    .bread-nav {
      font-size: 13px;
      font-weight: 800;
      &:hover {
        color: #5a9cf8;
        cursor: pointer;
      }
    }
    span {
      margin: 0 4px;
      font-size: 12px;
    }
  }
}
</style>